package org.spring.springboot.app.adv.advmobilemaininfo.domain.vo;

import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;
import org.spring.springboot.util.DateUtil;

import java.util.Date;

public class AdvMobileMainInfoSaveInVO {

    private static final long serialVersionUID = -1L;
    @ApiModelProperty(value = "id", hidden = false)
    private String id;
    @ApiModelProperty(value = "标题", hidden = false)
    private String title;
    @ApiModelProperty(value = "图片", hidden = false)
    private String photos;
    @ApiModelProperty(value = "开始时间(例如2017-01-01 00:00:00)", hidden = false)
    private String startDate;
    @ApiModelProperty(value = "结束时间(例如2017-01-01 23:59:59)", hidden = false)
    private String endDate;
    @ApiModelProperty(value = "内容", hidden = false)
    private String content;
    @ApiModelProperty(value = "区域s", hidden = false)
    private String areaIds;


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getPhotos() {
        return photos;
    }

    public void setPhotos(String photos) {
        this.photos = photos;
    }

    public String getStartDate() {
        return startDate;
    }

    public Date getStartDate_() {
        if(StringUtils.isBlank(this.startDate)){
            return new Date();
        }
       return DateUtil.strToDate(this.startDate);
    }

    public void setStartDate(String startDate) {
        this.startDate = startDate;
    }

    public String getEndDate() {
        return endDate;
    }
    public Date getEndDate_() {
        if(StringUtils.isBlank(this.endDate)){
            return new Date();
        }
        return DateUtil.strToDate(this.endDate);
    }

    public void setEndDate(String endDate) {
        this.endDate = endDate;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getAreaIds() {
        return areaIds;
    }

    public void setAreaIds(String areaIds) {
        this.areaIds = areaIds;
    }

    public int getZoneDay(){
        if (startDate == null || endDate == null) {
            return 0;
        }
        return DateUtil.zoneDays(getStartDate_(),getEndDate_());
    }
}